<template>
  <el-table
    :data="roleObjs"
    stripe
    style="width: 100%">
    <el-table-column
      prop="roleId"
      label="角色编号"
      width="180">
    </el-table-column>
    <el-table-column
      label="角色名称"
      width="250"
    >
      <template slot-scope="scope">
        <el-input
          placeholder="请输入内容"
          v-model="scope.row.roleName"
          clearable>
        </el-input>
      </template>
    </el-table-column>
    <el-table-column
      label="角色描述"
      width="180">
      <template slot-scope="scope">
        <el-input
          placeholder="请输入内容"
          v-model="scope.row.roleDescription"
          clearable>
        </el-input>
      </template>
    </el-table-column>
    <el-table-column
      label="功能列表"
    >
      <template slot-scope="scope">
        <el-checkbox-group v-model="scope.row.functionList">
          <el-checkbox label="授权中心" name="type"></el-checkbox>
          <el-checkbox label="转账管理" name="type"></el-checkbox>
          <el-checkbox label="交易管理" name="type"></el-checkbox>
          <el-checkbox label="日志管理" name="type"></el-checkbox>
          <el-checkbox label="个人中心" name="type"></el-checkbox>
        </el-checkbox-group>
      </template>
    </el-table-column>
    <el-table-column
      label="操作"
    >
      <template slot-scope="scope">
        <el-button
          size="mini"
          type="success"
          @click="handleSave(scope.$index, scope.row)">保存
        </el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
  export default {
    data() {
      return {
        roleObjs: []
      }
    },
    methods: {
      handleSave() {
        this.$router.push({ name: 'confirm', params: { roleObj: this.roleObjs[0],operation: '修改' }})
      }
    },
    mounted() {
      this.roleObjs = [this.$route.params.roleObj]
    }
  }
</script>

<style scoped>

</style>
